package com.qf.service.impl;

import com.qf.dao.ShowGoodDao;
import com.qf.dao.Showselect;
import com.qf.dao.impl.ShowGoodDaoImpl;
import com.qf.dao.impl.ShowselectImpl;
import com.qf.domain.Goods;
import com.qf.domain.GoodsType;
import com.qf.domain.User;
import com.qf.service.ShowGoodService;


import java.util.List;

public class ShowGoodServiceImpl implements ShowGoodService {
    private ShowGoodDao showGoodDao = new ShowGoodDaoImpl();
    private Showselect showselect = new ShowselectImpl();
    @Override
    public List<User> select() {
        return showGoodDao.slelect();
    }

    @Override
    public List<Goods> selectGoods(int id) {
        return showGoodDao.slelectGoods(id);
    }

    @Override
    public List<Goods> selectByUAD(StringBuilder where1, List<Object> i) {
        List<Goods> goods = showGoodDao.selectByUAD(where1, i);
        for (Goods good : goods) {
            GoodsType goodsType = showselect.selectById(good.getTypeid());
            good.setGoodsType(goodsType);
        }
        return goods;
    }

    @Override
    public List<GoodsType> findAll() {
        return showselect.selectGoodsTypefinall();
    }

//    @Override
//    public void remove(int parseInt) {
//        showGoodDao.delete();
//    }
}
